package com.panshi.qa.api;

import com.panshi.qa.api.vo.ItemQueryVo;
import com.panshi.qa.api.vo.QaQuestionFrontdesk;
import com.panshi.qa.api.vo.QaQuestionUncheck;
import com.panshi.vo.R;
import com.panshi.qa.api.vo.QaQuestion;
import feign.hystrix.FallbackFactory;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Hello world!
 *
 */
@FeignClient(name = "qa",fallback = FallbackFactory.Default.class,path = "/api")
@Component
public interface HasbeiQaApp {

    @ApiOperation("查询指定问答类型列表")
    @RequestMapping(value = "/{typeId}",method = RequestMethod.GET)
    public R question(@PathVariable(name = "typeId") Long typeId);

    @ApiOperation("查询所有问答列表")
    @RequestMapping(value = "/",method = RequestMethod.GET)
    public R question();

    @ApiOperation("查询指定问题详情")
    @RequestMapping(value = "/detail/{id}",method = RequestMethod.GET)
    public R detail(@PathVariable(name = "id") Long id);

    @ApiOperation("增加指定问题到未审核表里")
    @RequestMapping(value="/add",method = RequestMethod.POST)
    @ResponseBody
    public R addUncheckQuestoin(@RequestBody QaQuestionFrontdesk qaQuestionFrontdesk);

    @ApiOperation("查询问答列表的分页")
    @RequestMapping(value="/index/item",method = RequestMethod.POST)
    @ResponseBody
    public R itemQuery(@RequestBody ItemQueryVo itemQueryVo);

    @ApiOperation("增加指定问题到收藏表")
    @RequestMapping(value = "/addCollect",method = RequestMethod.POST)
    public R addCollect(@RequestBody  QaQuestionFrontdesk qaQuestionFrontdesk);

    @ApiOperation("增加指定问题到问题表")
    @RequestMapping(value = "/addQuestion",method = RequestMethod.POST)
    public R addQuestoin(@RequestBody  QaQuestionFrontdesk qaQuestionFrontdesk);

    @ApiOperation("删除指定未审核表问题")
    @RequestMapping(value = "/index/delUncheck/{id}",method = RequestMethod.DELETE)
    @ResponseBody
    public R delUncheckQuestion(@PathVariable("id") int id);

    @ApiOperation("修改审核通过指定问题")
    @RequestMapping(value = "/index/updateQuestion",method = RequestMethod.PUT)
    @ResponseBody
    public R updateQuestion(@RequestBody QaQuestion qaQuestion);

    @ApiOperation("查询问题口腔类型列表")
    @RequestMapping(value = "/index/thtypeQuery",method = RequestMethod.GET)
    public String thtypeQuery();

    @ApiOperation("查询首页推荐问答")
    @RequestMapping(value="homeQaQuesitonPage",method = RequestMethod.GET)
    public R homeQaQuesitonPage();

    @ApiOperation("修改未审核通过指定问题")
    @RequestMapping(value = "/index/updateQuestionUncheck",method = RequestMethod.PUT)
    @ResponseBody
    public R updateQuestionUncheck(@RequestBody QaQuestionUncheck qaQuestionUncheck);

    @ApiOperation("查询指定问题ID信息")
    @RequestMapping(value = "/questionDetail/{id}",method = RequestMethod.GET)
    public R questionDetail(@PathVariable(name="id") Long id);

    @ApiOperation("查询问答审核通过列表的后台")
    @RequestMapping(value = "/index/pageQuery",method = RequestMethod.POST)
    public Map<String,Object> pageQuery(@RequestBody ItemQueryVo itemQueryVo);

    @ApiOperation("查询问答未审核列表的后台")
    @RequestMapping(value = "/index/pageUncheckQuery",method = RequestMethod.POST)
    public Map<String,Object> itemUncheckQuery(@RequestBody ItemQueryVo itemQueryVo);

    @ApiOperation("查询指定问题后台详情")
    @RequestMapping(value = "/detailSystem/{id}",method = RequestMethod.GET)
    public Map<String,Object> detailSystem(@PathVariable(name="id") Long id);

}
